package com.wuzuqing.android.eightdiagrams.model

import com.wuzuqing.android.eightdiagrams.utils.DataUtils

class Fc3DOpenModel(
    val date: String,
    var model: DataUtils.Fc3DModel? = null,
    var gan: String? = null,
    var men: String? = null,
    var shen: String? = null,
    var xing: String? = null
) {

    private fun genNewStr(str1: String?, str2: String?): String? {
        if (str2 == null) {
            return str1
        }
        if (str1 == null) {
            return str2
        } else if (!str1.contains(str2)) {
            return "$str1$str2"
        }
        return str1
    }

    fun appendGan(str: String?) {
        this.gan = genNewStr(this.gan, str)
    }

    fun appendMen(str: String?) {
        this.men = genNewStr(this.men, str)
    }

    fun appendXing(str: String?) {
        this.xing = genNewStr(this.xing, str)
    }

    fun appendShen(str: String?) {
        this.shen = genNewStr(this.shen, str)
    }
}